package com.rkc.service;

import com.rkc.enums.ProductOrderPayTypeEnum;
import com.rkc.model.OrderMessage;
import com.rkc.request.ConfirmOrderRequest;
import com.rkc.request.RepayOrderRequest;
import com.rkc.utils.JsonData;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 冉堃赤
 * @since 2021-10-30
 */
public interface ProductOrderService {

    /**
     * 提交确认订单
     * @param confirmOrderRequest
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest confirmOrderRequest);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    /**
     * 队列监听调用。定时关单
     * @param orderMessage
     * @return
     */
    boolean closeProductOrder(OrderMessage orderMessage);

    /**
     * 处理支付结果回调通知
     * @param payType
     * @param paramsMap
     * @return
     */
    JsonData handleOrderCallback(ProductOrderPayTypeEnum payType, Map<String, String> paramsMap);

    /**
     * 二次支付
     * @param repayOrderRequest
     * @return
     */
    JsonData repay(RepayOrderRequest repayOrderRequest);

}
